3.13.78 \(\int x \text {ArcTan}(x) \log (1+x^2) \, dx\) [1278]

Optimal. Leaf size=49 \[ \frac {3 x}{2}-\frac {3 \text {ArcTan}(x)}{2}-\frac {1}{2} x^2 \text {ArcTan}(x)-\frac {1}{2} x \log \left (1+x^2\right )+\frac {1}{2} \left (1+x^2\right ) \text {ArcTan}(x) \log \left (1+x^2\right ) \]

[Out]

3/2*x-3/2*arctan(x)-1/2*x^2*arctan(x)-1/2*x*ln(x^2+1)+1/2*(x^2+1)*arctan(x)*ln(x^2+1)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 8, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.800, Rules used = {4946, 327, 209, 2504, 2436, 2332, 5139, 2498} \begin {gather*} -\frac {1}{2} x^2 \text {ArcTan}(x)+\frac {1}{2} \left (x^2+1\right ) \text {ArcTan}(x) \log \left (x^2+1\right )-\frac {3 \text {ArcTan}(x)}{2}-\frac {1}{2} x \log \left (x^2+1\right )+\frac {3 x}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x*ArcTan[x]*Log[1 + x^2],x]

[Out]

(3*x)/2 - (3*ArcTan[x])/2 - (x^2*ArcTan[x])/2 - (x*Log[1 + x^2])/2 + ((1 + x^2)*ArcTan[x]*Log[1 + x^2])/2

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2436

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.), x_Symbol] :> Dist[1/e, Subst[Int[(a + b*Log[c*
x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, n, p}, x]

Rule 2498

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)], x_Symbol] :> Simp[x*Log[c*(d + e*x^n)^p], x] - Dist[e*n*p, Int[
x^n/(d + e*x^n), x], x] /; FreeQ[{c, d, e, n, p}, x]

Rule 2504

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*(x_)^(m_.), x_Symbol] :> Dist[1/n, Subst[I
nt[x^(Simplify[(m + 1)/n] - 1)*(a + b*Log[c*(d + e*x)^p])^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, e, m, n, p,
 q}, x] && IntegerQ[Simplify[(m + 1)/n]] && (GtQ[(m + 1)/n, 0] || IGtQ[q, 0]) &&  !(EqQ[q, 1] && ILtQ[n, 0] &&
 IGtQ[m, 0])

Rule 4946

Int[((a_.) + ArcTan[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)*((a + b*ArcTan[c*x^
n])^p/(m + 1)), x] - Dist[b*c*n*(p/(m + 1)), Int[x^(m + n)*((a + b*ArcTan[c*x^n])^(p - 1)/(1 + c^2*x^(2*n))),
x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0] && (EqQ[p, 1] || (EqQ[n, 1] && IntegerQ[m])) && NeQ[m, -1]

Rule 5139

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_.) + Log[(f_.) + (g_.)*(x_)^2]*(e_.))*(x_)^(m_.), x_Symbol] :> With
[{u = IntHide[x^m*(d + e*Log[f + g*x^2]), x]}, Dist[a + b*ArcTan[c*x], u, x] - Dist[b*c, Int[ExpandIntegrand[u
/(1 + c^2*x^2), x], x], x]] /; FreeQ[{a, b, c, d, e, f, g}, x] && IGtQ[(m + 1)/2, 0]

Rubi steps

\begin {align*} \int x \tan ^{-1}(x) \log \left (1+x^2\right ) \, dx &=-\frac {1}{2} x^2 \tan ^{-1}(x)+\frac {1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )-\int \left (-\frac {x^2}{2 \left (1+x^2\right )}+\frac {1}{2} \log \left (1+x^2\right )\right ) \, dx\\ &=-\frac {1}{2} x^2 \tan ^{-1}(x)+\frac {1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )+\frac {1}{2} \int \frac {x^2}{1+x^2} \, dx-\frac {1}{2} \int \log \left (1+x^2\right ) \, dx\\ &=\frac {x}{2}-\frac {1}{2} x^2 \tan ^{-1}(x)-\frac {1}{2} x \log \left (1+x^2\right )+\frac {1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )-\frac {1}{2} \int \frac {1}{1+x^2} \, dx+\int \frac {x^2}{1+x^2} \, dx\\ &=\frac {3 x}{2}-\frac {1}{2} \tan ^{-1}(x)-\frac {1}{2} x^2 \tan ^{-1}(x)-\frac {1}{2} x \log \left (1+x^2\right )+\frac {1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )-\int \frac {1}{1+x^2} \, dx\\ &=\frac {3 x}{2}-\frac {3}{2} \tan ^{-1}(x)-\frac {1}{2} x^2 \tan ^{-1}(x)-\frac {1}{2} x \log \left (1+x^2\right )+\frac {1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 38, normalized size = 0.78 \begin {gather*} \frac {1}{2} \left (3 x-3 \text {ArcTan}(x)-x^2 \text {ArcTan}(x)+\left (-x+\left (1+x^2\right ) \text {ArcTan}(x)\right ) \log \left (1+x^2\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x*ArcTan[x]*Log[1 + x^2],x]

[Out]

(3*x - 3*ArcTan[x] - x^2*ArcTan[x] + (-x + (1 + x^2)*ArcTan[x])*Log[1 + x^2])/2

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 3.10, size = 762, normalized size = 15.55

method result size
default \(\left (-i \arctan \left (x \right )+x \arctan \left (x \right )-1\right ) \left (x +i\right ) \ln \left (\frac {i x +1}{\sqrt {x^{2}+1}}\right )+\frac {i \left (3-2 i \arctan \left (x \right ) \ln \left (2\right ) x^{2}+2 i \arctan \left (x \right ) \ln \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right ) x^{2}+\arctan \left (x \right ) \pi \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{3} x^{2}-\arctan \left (x \right ) \pi \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{2} \mathrm {csgn}\left (i \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )\right ) x^{2}+i \pi \,\mathrm {csgn}\left (i \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{2}+\pi \,\mathrm {csgn}\left (i \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{2} x +\pi \,\mathrm {csgn}\left (\frac {i \sqrt {x^{2}+1}}{i x +1}\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{2} x -\arctan \left (x \right ) \pi \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{2} \mathrm {csgn}\left (\frac {i \sqrt {x^{2}+1}}{i x +1}\right ) x^{2}+i \arctan \left (x \right ) x^{2}-\pi \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{3} x +2 i \arctan \left (x \right ) \ln \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )-2 i \ln \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right ) x +2 i \ln \left (2\right ) x -2 \ln \left (2\right )-i \pi \,\mathrm {csgn}\left (i \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )\right ) \mathrm {csgn}\left (\frac {i \sqrt {x^{2}+1}}{i x +1}\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )+\pi \,\mathrm {csgn}\left (i \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )\right ) \mathrm {csgn}\left (\frac {i \sqrt {x^{2}+1}}{i x +1}\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right ) \arctan \left (x \right )-2 i \ln \left (2\right ) \arctan \left (x \right )+\pi \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{3} \arctan \left (x \right )-i \pi \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{3}-\pi \,\mathrm {csgn}\left (i \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{2} \arctan \left (x \right )-\pi \,\mathrm {csgn}\left (\frac {i \sqrt {x^{2}+1}}{i x +1}\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{2} \arctan \left (x \right )+i \pi \,\mathrm {csgn}\left (\frac {i \sqrt {x^{2}+1}}{i x +1}\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{2}-\pi \,\mathrm {csgn}\left (i \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )\right ) \mathrm {csgn}\left (\frac {i \sqrt {x^{2}+1}}{i x +1}\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right ) x -3 i x +5 i \arctan \left (x \right )+\arctan \left (x \right ) \pi \,\mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right ) \mathrm {csgn}\left (i \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )\right ) \mathrm {csgn}\left (\frac {i \sqrt {x^{2}+1}}{i x +1}\right ) x^{2}\right )}{2}\) \(762\)
risch \(\text {Expression too large to display}\) \(15978\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*arctan(x)*ln(x^2+1),x,method=_RETURNVERBOSE)

[Out]

(-I*arctan(x)+x*arctan(x)-1)*(x+I)*ln((1+I*x)/(x^2+1)^(1/2))+1/2*I*(3-3*I*x-Pi*csgn(I/(x^2+1)^(1/2))^3*x+Pi*cs
gn(I*((1+I*x)^2/(x^2+1)+1))*csgn(I/(x^2+1)^(1/2))^2*x+Pi*csgn(I/(1+I*x)*(x^2+1)^(1/2))*csgn(I/(x^2+1)^(1/2))^2
*x-Pi*csgn(I*((1+I*x)^2/(x^2+1)+1))*csgn(I/(x^2+1)^(1/2))^2*arctan(x)+Pi*csgn(I/(x^2+1)^(1/2))^3*arctan(x)+2*I
*ln(2)*x-2*ln(2)-arctan(x)*Pi*csgn(I/(x^2+1)^(1/2))^2*csgn(I*((1+I*x)^2/(x^2+1)+1))*x^2-arctan(x)*Pi*csgn(I/(x
^2+1)^(1/2))^2*csgn(I/(1+I*x)*(x^2+1)^(1/2))*x^2-I*Pi*csgn(I/(x^2+1)^(1/2))*csgn(I*((1+I*x)^2/(x^2+1)+1))*csgn
(I/(1+I*x)*(x^2+1)^(1/2))-I*Pi*csgn(I/(x^2+1)^(1/2))^3+I*arctan(x)*x^2+2*I*arctan(x)*ln((1+I*x)^2/(x^2+1)+1)-2
*I*arctan(x)*ln(2)-2*I*ln((1+I*x)^2/(x^2+1)+1)*x-Pi*csgn(I/(1+I*x)*(x^2+1)^(1/2))*csgn(I/(x^2+1)^(1/2))^2*arct
an(x)+5*I*arctan(x)+I*Pi*csgn(I/(1+I*x)*(x^2+1)^(1/2))*csgn(I/(x^2+1)^(1/2))^2+arctan(x)*Pi*csgn(I/(x^2+1)^(1/
2))^3*x^2+I*Pi*csgn(I*((1+I*x)^2/(x^2+1)+1))*csgn(I/(x^2+1)^(1/2))^2-2*I*arctan(x)*ln(2)*x^2+2*I*arctan(x)*ln(
(1+I*x)^2/(x^2+1)+1)*x^2+arctan(x)*Pi*csgn(I/(x^2+1)^(1/2))*csgn(I*((1+I*x)^2/(x^2+1)+1))*csgn(I/(1+I*x)*(x^2+
1)^(1/2))*x^2+Pi*csgn(I*((1+I*x)^2/(x^2+1)+1))*csgn(I/(1+I*x)*(x^2+1)^(1/2))*csgn(I/(x^2+1)^(1/2))*arctan(x)-P
i*csgn(I*((1+I*x)^2/(x^2+1)+1))*csgn(I/(1+I*x)*(x^2+1)^(1/2))*csgn(I/(x^2+1)^(1/2))*x)

________________________________________________________________________________________

Maxima [A]
time = 0.55, size = 39, normalized size = 0.80 \begin {gather*} -\frac {1}{2} \, {\left (x^{2} - {\left (x^{2} + 1\right )} \log \left (x^{2} + 1\right ) + 1\right )} \arctan \left (x\right ) - \frac {1}{2} \, x \log \left (x^{2} + 1\right ) + \frac {3}{2} \, x - \arctan \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*arctan(x)*log(x^2+1),x, algorithm="maxima")

[Out]

-1/2*(x^2 - (x^2 + 1)*log(x^2 + 1) + 1)*arctan(x) - 1/2*x*log(x^2 + 1) + 3/2*x - arctan(x)

________________________________________________________________________________________

Fricas [A]
time = 2.27, size = 33, normalized size = 0.67 \begin {gather*} -\frac {1}{2} \, {\left (x^{2} + 3\right )} \arctan \left (x\right ) + \frac {1}{2} \, {\left ({\left (x^{2} + 1\right )} \arctan \left (x\right ) - x\right )} \log \left (x^{2} + 1\right ) + \frac {3}{2} \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*arctan(x)*log(x^2+1),x, algorithm="fricas")

[Out]

-1/2*(x^2 + 3)*arctan(x) + 1/2*((x^2 + 1)*arctan(x) - x)*log(x^2 + 1) + 3/2*x

________________________________________________________________________________________

Sympy [A]
time = 0.26, size = 56, normalized size = 1.14 \begin {gather*} \frac {x^{2} \log {\left (x^{2} + 1 \right )} \operatorname {atan}{\left (x \right )}}{2} - \frac {x^{2} \operatorname {atan}{\left (x \right )}}{2} - \frac {x \log {\left (x^{2} + 1 \right )}}{2} + \frac {3 x}{2} + \frac {\log {\left (x^{2} + 1 \right )} \operatorname {atan}{\left (x \right )}}{2} - \frac {3 \operatorname {atan}{\left (x \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*atan(x)*ln(x**2+1),x)

[Out]

x**2*log(x**2 + 1)*atan(x)/2 - x**2*atan(x)/2 - x*log(x**2 + 1)/2 + 3*x/2 + log(x**2 + 1)*atan(x)/2 - 3*atan(x
)/2

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 86 vs. \(2 (39) = 78\).
time = 0.38, size = 86, normalized size = 1.76 \begin {gather*} \frac {1}{4} \, \pi x^{2} \log \left (x^{2} + 1\right ) \mathrm {sgn}\left (x\right ) - \frac {1}{2} \, x^{2} \arctan \left (\frac {1}{x}\right ) \log \left (x^{2} + 1\right ) - \frac {1}{4} \, \pi x^{2} \mathrm {sgn}\left (x\right ) + \frac {1}{2} \, x^{2} \arctan \left (\frac {1}{x}\right ) + \frac {1}{4} \, \pi \log \left (x^{2} + 1\right ) \mathrm {sgn}\left (x\right ) - \frac {1}{2} \, x \log \left (x^{2} + 1\right ) - \frac {1}{2} \, \arctan \left (\frac {1}{x}\right ) \log \left (x^{2} + 1\right ) + \frac {3}{2} \, x - \frac {3}{2} \, \arctan \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*arctan(x)*log(x^2+1),x, algorithm="giac")

[Out]

1/4*pi*x^2*log(x^2 + 1)*sgn(x) - 1/2*x^2*arctan(1/x)*log(x^2 + 1) - 1/4*pi*x^2*sgn(x) + 1/2*x^2*arctan(1/x) +
1/4*pi*log(x^2 + 1)*sgn(x) - 1/2*x*log(x^2 + 1) - 1/2*arctan(1/x)*log(x^2 + 1) + 3/2*x - 3/2*arctan(x)

________________________________________________________________________________________

Mupad [B]
time = 0.47, size = 48, normalized size = 0.98 \begin {gather*} \frac {\ln \left (x^2+1\right )\,\mathrm {atan}\left (x\right )}{2}-x\,\left (\frac {\ln \left (x^2+1\right )}{2}-\frac {3}{2}\right )-x^2\,\left (\frac {\mathrm {atan}\left (x\right )}{2}-\frac {\ln \left (x^2+1\right )\,\mathrm {atan}\left (x\right )}{2}\right )-\frac {3\,\mathrm {atan}\left (x\right )}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*log(x^2 + 1)*atan(x),x)

[Out]

(log(x^2 + 1)*atan(x))/2 - x*(log(x^2 + 1)/2 - 3/2) - x^2*(atan(x)/2 - (log(x^2 + 1)*atan(x))/2) - (3*atan(x))
/2

________________________________________________________________________________________